#pragma once
namespace jz {
#include"HashTable.h"
	template<class K, class Hash = HashFunc<K>>
	class unordered_set
	{
		struct set_keyoft
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
	public:
		typedef typename HashTable<K, K, set_keyoft, Hash>::iterator iterator;
		iterator begin()
		{
			return u_set.begin();
		}
		iterator end()
		{
			return u_set.end();
		}
		bool insert(const K& key)
		{
			return u_set.Insert(key);
		}
	private:
		HashTable<K, K, set_keyoft, Hash> u_set;
	};

	void testset()
	{
		unordered_set<int> us;
		us.insert(3);
		us.insert(1);
		us.insert(5);
		us.insert(15);
		us.insert(45);
		us.insert(7);
		for (auto e : us)
		{
			cout << e<< endl;
		}
		cout << endl;
	}
}